package com.net.oil.bean;

/*
 * Created by lch on 2018/2/10 0010.
 */

import com.net.oil.http.AppHttpCode;

public class BaseBean<T> {
    private int code;
    private String msg;
    private T data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    /**
     * 根据code判断请求是否成功
     * @return  boolean
     */
    public boolean isCodeSuccess(){
        return code == AppHttpCode.SUCCESS_OK;
    }
}
